/**
 * \class rgView.h
 */

#ifndef _RG_VIEW_H_
#define _RG_VIEW_H_

#include <main.h>
#include "SDL.h"
#include <SDL_TTF.h>

namespace rg
{
	class view
	{
	public:
		view(const rgInt& xRes, const rgInt& yres, const rgBool gl = rgFALSE);

		~view(void);

		/* Borramos la pantalla */
		inline void clear()
		{
			SDL_FillRect(m_pSurface, &m_fullScreen, m_black);
		}

		void print( const rgUint16& x, const rgUint16& y, const string& str);
		void drawPoint( const rgUint16& x, const rgUint16& y, const rgUint16& w, const rgUint16& h, const rgUint32& color );
		void DrawPixel(Uint8 R, Uint8 G, Uint8 B, Uint32 x, Uint32 y);
		void DrawPixel2(const rgUint32& color, const rgUint32& x, const rgUint32& y);

		void LockSurface();
		void UnLockSurface();

		inline rgInt getResX(){return m_xRes;}
		inline rgInt getResY(){return m_yRes;}

		SDL_Surface* m_pSurface;
	private:
		
		rgInt m_xRes;
		rgInt m_yRes;
		SDL_Rect m_point;
		SDL_Rect m_fullScreen;
		rgUint32 m_black;
		rgUint32 m_pitch; // in bytes

		TTF_Font *m_fntCourier;

	};
} // namespace rg
#endif // _RG_VIEW_H_